{include file='admin/before_body.phtml' title='后台首页'}
<style>
.user-avatar { border: 2px solid #c9d6e5;border-radius: 100%;max-width: 50px;margin-right: 10px;margin-left: 0;box-shadow: none; }
tbody .btn { margin-bottom: 2px }
</style>
  {include file='admin/header.phtml'}
    <div class="main-container" id="main-container">
      <script type="text/javascript">try { ace.settings.check('main-container' , 'fixed') }catch(e) {  }</script>
      <div class="main-container-inner">
        {include file='admin/sidebar.phtml'}
        <div class="main-content">
{$breadcrumbs=[]}
{$breadcrumbs[] = ['name' => '店铺设置', 'icon' => 'icon-home home-icon']}
{$breadcrumbs[] = ['name' => '商品管理列表', 'isactive' => true]}
{include file='admin/breadcrumb.phtml' breadcrumbs=$breadcrumbs}
          <div class="page-content">
            {html_messages}
            <div class="row">
            {include file='admin/store/item_search.phtml' breadcrumbs=$breadcrumbs}
              <div class="col-xs-12"><div class="space-6"></div></div>
<div class="col-xs-12">
  <p>
    {if $account->checkPermission(['store.item.edit'])}
      <a href="{url('admin/store/itemAdd')}" class="btn btn-primary btn-sm"><i class="icon-plus align-top bigger-125"></i>新增商品</a>
    {/if}
  </p>
  <div class="table-responsive">
    <div id="sample-table-2_wrapper" class="dataTables_wrapper" live="grid">
      <table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
        <thead>
          <tr>
            <th class="center">添加者</th>
            <th class="center" width="150">商品图片</th>
            <th class="center">商品名称</th>
            <th class="left" width="250">详情</th>
            <th class="center" width="50">状态</th>
            <th class="center" width="100">创建时间</th>
            <th class="center" width="100">更新时间</th>
            {if $account->checkPermission(['store.item.edit'])}
              <th class="center" width="60">操作</th>
            {/if}
          </tr>
        </thead>
        <tbody>
          {if empty($list)}
            <tr><td colSpan="10"><p class="center">找不到符合条件的记录<p></td></tr>
          {/if}
          {foreach $list as $item}
            <tr data-id="{$item->item_id}">
              <td class="center">{$item->nickname}</td>
              <td class="center">
                <div class="thumbnail">
                  <img src="{$item->image}">
                </div>
              </td>
              <td class="center">{$item->name}</td>
              <td class="left">
<p>分类： {$item->cate}</p>
<p>消耗时长： {$item->lifetime}</p>
<p>鲜花收益： {$item->flowers}</p>
<hr>
{$item->describe}

              </td>
              <td class="center">
              {if $item->status == Item::IS_OFFLINE}
                <span class="label label-sm label-warning arrowed arrowed-righ">下架</span>
              {elseif $item->status == Item::IS_ONLINE}
                <span class="label label-sm label-success arrowed arrowed-righ">上架</span>
              {else}
                {$item->status}
              {/if}
              </td>
              <td class="center">{$item->created|date_format:'Y-m-d G:i:s'}</td>
              <td class="center">{$item->updated|date_format:'Y-m-d G:i:s'}</td>
              {if $account->checkPermission(['store.item.edit'])}
                <td class="center">
                  {if $item->status == Item::IS_OFFLINE}
                    <a href="{url('admin/store/itemUpdated/online/')}{$item->item_id}" class="btn btn-xs btn-success modal-confirm" data-confirm="确认要上架商品[ {$item->name} ]">上架</a>
                    <a href="{url('admin/store/itemUpdated/delete/')}{$item->item_id}" class="btn btn-xs btn-danger modal-confirm" data-confirm="确认要删除商品[ {$item->name} ]?<br/>删除商品后会将在线的该商品全部下架，请谨慎操作！！">删除</a>
                  {elseif $item->status == Item::IS_ONLINE}
                    <a href="{url('admin/store/itemUpdated/offline/')}{$item->item_id}" class="btn btn-xs btn-warning modal-confirm" data-confirm="确认要下架商品[ {$item->name} ]<br/>下架商品后，该商品不在前端出现选择，但不影响已经上架的商品">下架</a>
                  {/if}
                </td>
              {/if}
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="row">
        <div class="col-sm-6">
        </div>
        <div class="col-sm-6">
          <div class="dataTables_paginate paging_bootstrap">
            {html_pagination page="$page" rows="$rows" count="$count" showinfo="1"
              url="{url('admin/store/item')}" query=$query}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>



            </div>
          </div>
        </div>
      </div>
    </div>
</body>
{include file='admin/after_body.phtml'}
</html>

